<script>
// 使用WebGL批量渲染
const renderer = new AMap.WebGLRenderer({
  map: mapInstance.value,
  unitTypes: {
    tank: {
      modelUrl: '/models/tank.glb',
      scale: 0.5
    },
    fighter: {
      modelUrl: '/models/fighter.glb',
      scale: 0.3
    }
  }
});

watchEffect(() => {
  renderer.renderUnits(battleStore.units.map(u => ({
    id: u.id,
    type: u.unitType,
    position: u.position,
    rotation: u.direction
  })));
});
</script>